Skip to content

fix(calendar): skip malformed ical events - #1870

Open
keilogic wants to merge 2 commits into
runbox:masterfrom
keilogic:fix/calendar-skip-bad-ical-1484
Open

fix(calendar): skip malformed ical events#1870
keilogic wants to merge 2 commits into
runbox:masterfrom
keilogic:fix/calendar-skip-bad-ical-1484

Conversation

@keilogic

Copy link
Copy Markdown
Contributor

Summary

Closes #1484.

This makes calendar event loading tolerant of malformed iCalendar data. If one stored event fails while parsing or generating display occurrences, the service now reports that event through the existing errorLog path and keeps loading the remaining valid events.

The first commit adds the regression test by itself so it can be cherry-picked separately. The second commit contains the implementation.

Tests

  • npx ng test --watch=false --browsers=FirefoxHeadless --include=src/app/calendar-app/calendar.service.spec.ts - 10 SUCCESS
  • npx tsc -p tsconfig.json --noEmit
  • git diff --check
  • Manual production build steps on Windows PowerShell:
    • node src/build/pre-build.js
    • npx ng build runbox7 --configuration production --base-href /app/
    • node src/build/post-build.js
  • npx ng test --watch=false --browsers=FirefoxHeadless - 246 SUCCESS, 2 skipped
  • npm run lint - exits 0 with the repository's existing warning baseline
  • npm run policy - exits 0; it still prints existing historical commit-message warnings outside this branch

Note: the build pre-step regenerated src/app/changelog/changes.ts, but I did not include that generated file so this PR stays scoped to the calendar fix.

AI Disclosure

I used OpenAI Codex while working on this PR. Codex assisted with editing src/app/calendar-app/calendar.service.ts and src/app/calendar-app/calendar.service.spec.ts; I reviewed the diff and ran the validation commands above locally.

dav_events['test/broken'] = {
calendar: 'test',
id: 'test/broken',
ical: 'BEGIN:VCALENDAR\nBEGIN:VEVENT\nDESCRIPTION;ALTREP\nDTSTART:20210425T090000\nDTEND:20210425T100000\nSUMMARY:Broken\nEND:VEVENT\nEND:VCALENDAR\n'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put the "broken" ical value not all on one long line (newlines are fine), and document what exactly is "broken" in the test data?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @keilogic could you respond to the requested changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#Calendar: iCal events with errors prevent whole calendar loading

2 participants